package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.HsDonorLogMapper;
import com.ruoyi.system.domain.HsDonorLog;
import com.ruoyi.system.service.IHsDonorLogService;

/**
 * 捐赠记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-11
 */
@Service
public class HsDonorLogServiceImpl implements IHsDonorLogService 
{
    @Autowired
    private HsDonorLogMapper hsDonorLogMapper;

    /**
     * 查询捐赠记录
     * 
     * @param id 捐赠记录主键
     * @return 捐赠记录
     */
    @Override
    public HsDonorLog selectHsDonorLogById(Long id)
    {
        return hsDonorLogMapper.selectHsDonorLogById(id);
    }

    /**
     * 查询捐赠记录列表
     * 
     * @param hsDonorLog 捐赠记录
     * @return 捐赠记录
     */
    @Override
    public List<HsDonorLog> selectHsDonorLogList(HsDonorLog hsDonorLog)
    {
        return hsDonorLogMapper.selectHsDonorLogList(hsDonorLog);
    }

    /**
     * 新增捐赠记录
     * 
     * @param hsDonorLog 捐赠记录
     * @return 结果
     */
    @Override
    public int insertHsDonorLog(HsDonorLog hsDonorLog)
    {
        hsDonorLog.setCreateTime(DateUtils.getNowDate());
        return hsDonorLogMapper.insertHsDonorLog(hsDonorLog);
    }

    /**
     * 修改捐赠记录
     * 
     * @param hsDonorLog 捐赠记录
     * @return 结果
     */
    @Override
    public int updateHsDonorLog(HsDonorLog hsDonorLog)
    {
        hsDonorLog.setUpdateTime(DateUtils.getNowDate());
        return hsDonorLogMapper.updateHsDonorLog(hsDonorLog);
    }

    /**
     * 批量删除捐赠记录
     * 
     * @param ids 需要删除的捐赠记录主键
     * @return 结果
     */
    @Override
    public int deleteHsDonorLogByIds(Long[] ids)
    {
        return hsDonorLogMapper.deleteHsDonorLogByIds(ids);
    }

    /**
     * 删除捐赠记录信息
     * 
     * @param id 捐赠记录主键
     * @return 结果
     */
    @Override
    public int deleteHsDonorLogById(Long id)
    {
        return hsDonorLogMapper.deleteHsDonorLogById(id);
    }
}
